﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using 深入浅出WPF_BookDemo.Views;

namespace 深入浅出WPF_BookDemo.UserController
{
    /// <summary>
    /// WeatherDetailView.xaml 的交互逻辑
    /// </summary>
    public partial class WeatherDetailView : UserControl
    {
        public WeatherDetailView()
        {
            InitializeComponent();
        }

        private Weather weather;
        public Weather Weather
        {
            get { return weather; }
            set
            {
                weather = value;
                this.textBlockDate.Text = weather.Date.ToString("yyyy/MM/dd");
                this.textBlockCity.Text = weather.City.ToString();
                this.textBlockStatus.Text = weather.Status.ToString();
                string uriStr = string.Format(@"/Icons/{0}.png", weather.Status);
                this.imagePhoto.Source = new BitmapImage(new Uri(uriStr, UriKind.Relative));
            }

        }
    }
}
